<template>
  <span>
    <el-button v-if="!phone" size="mini" @click="onView">点击查看</el-button>
    <span class="ml-5">{{ phone }}</span>
  </span>
</template>

<script>
import { getOrderPhone } from "@/api/orderDispatch"
export default {
  props: {
    orderInfo: {
      type: Object,
      default: () => {}
    }
  },
  data() {
    return {
      phone: ''
    };
  },
  methods: {
    init() {
      this.phone = ''
    },
    onView() {
      getOrderPhone({orderId: this.orderInfo.id}).then(res => {
        this.phone = (res.data.data && res.data.data.data) || ''
      })
    },
  }
};
</script>
<style lang="scss" scoped>

</style>